'use strict'

const koa = require('koa');
const webpack = require('webpack');

const app = new koa();
const koaWebpack = require('koa-webpack');

// Tell express to use the webpack-dev-middleware and use the webpack.config.js
// configuration file as a base.
const config = require('./webpack.config.js');
koaWebpack({
    config
}).then(middleware => {
    app.use(middleware);

    // Serve the files on port 3000.
    app.listen(3000, function () {
        console.log('Example app listening on port 3000!\n');
    });
});